#include "Team.h"

Team::Team() {
	tableau = new Tableau(this);
}

Team::~Team() {
	// Deleting players and tableau
	
	qDebug() << "~Team()";
	
	for (int i=0; i<size(); i++) {
		delete this->at(i);
	}
	//foreach(Player* player, this) {
	//	delete player;
	//}
	
	delete tableau;
}



Tableau* Team::getTableau() {
	return tableau;
}


/**
 * Add a player to the team.
 * (proxy for native method, if further restrictions are needed)
 */
void Team::addPlayer(Player* player) {
	//if (this->size() < 3)
	this->append(player);
}


